(** 
    Page.mli

    Bozman Çagdas <bozman.cagdas@gmail.com> - 2011
    Razakamiadana Tefin <tefy.razaka@gmail.com>   - 2011
*)

type page

module PageSet : sig
    type elt = page
    type t
    val empty : t
    val is_empty : t -> bool
    val mem : elt -> t -> bool
    val add : elt -> t -> t
    val singleton : elt -> t
    val remove : elt -> t -> t
    val union : t -> t -> t
    val inter : t -> t -> t
    val diff : t -> t -> t
    val compare : t -> t -> int
    val equal : t -> t -> bool
    val subset : t -> t -> bool
    val iter : (elt -> unit) -> t -> unit
    val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
    val for_all : (elt -> bool) -> t -> bool
    val exists : (elt -> bool) -> t -> bool
    val filter : (elt -> bool) -> t -> t
    val partition : (elt -> bool) -> t -> t * t
    val cardinal : t -> int
    val elements : t -> elt list
    val min_elt : t -> elt
    val max_elt : t -> elt
    val choose : t -> elt
    val split : elt -> t -> t * bool * t
end

(** Initializes a page with the page title. *)
val init : string -> page

(** Returns an integer set of backlinks id's of the page.
    For example if we have :
      Scala -> WiKaml -> OCaml,
    backlinks_ids wiKaml will return the page id of Scala. *)
val backlinks_ids : page -> Sets.IntSet.t

(** Returns a string set of backlinks page title. 
    For example if we have :
      Scala -> WiKaml -> OCaml,
    backlinks_titles wiKaml will return the page title of Scala. *)
val backlinks_titles : page -> Sets.StringSet.t

(** Returns an integer set of inlinks id's of the page. 
    Inlinks are the links of a page. For example if we have :
      Scala -> WiKaml -> OCaml,
    inlinks_ids wiKaml will return the page id of OCaml. *)
val inlinks_ids : page -> Sets.IntSet.t

(** Returns a string set of inlinks page title's . 
    Inlinks are the links of a page. For example if we have :
      Scala -> WiKaml -> OCaml,
    inlinks_titles wiKaml will return the page title of OCaml. *)
val inlinks_titles : page -> Sets.StringSet.t

(** Returns the wiki content of a page in wiki syntax. The result is between
    the node <wikitext>*</wikitext> *)
val wiki_text : page -> string
